<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>TURN Server: turn::StunMsgChannel Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">TURN Server
   &#160;<span id="projectnumber">1.5</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceturn.html">turn</a>      </li>
      <li class="navelem"><a class="el" href="classturn_1_1StunMsgChannel.html">StunMsgChannel</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">turn::StunMsgChannel Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for turn::StunMsgChannel:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classturn_1_1StunMsgChannel.png" usemap="#turn::StunMsgChannel_map" alt=""/>
  <map id="turn::StunMsgChannel_map" name="turn::StunMsgChannel_map">
<area href="classturn_1_1StunMsg.html" alt="turn::StunMsg" shape="rect" coords="0,0,136,24"/>
</map>
 </div></div>

<p><a href="classturn_1_1StunMsgChannel-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a9e2a2b62acf5ad60d306507e94ad3084"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#a9e2a2b62acf5ad60d306507e94ad3084">StunMsgChannel</a> (u16bits cn, int length)</td></tr>
<tr class="memitem:a5165aa2f12c89bbe7a7cefb5ce929aa7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#a5165aa2f12c89bbe7a7cefb5ce929aa7">StunMsgChannel</a> (u08bits *buffer, size_t total_sz, size_t sz, bool constructed)  throw (WrongStunBufferFormatException)</td></tr>
<tr class="memitem:a1eca150860372a9fa24e783f8f9ecc7a"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#a1eca150860372a9fa24e783f8f9ecc7a">~StunMsgChannel</a> ()</td></tr>
<tr class="memitem:a33f7a5106eaa80d4c7c73bdadcd7cfef"><td class="memItemLeft" align="right" valign="top">u16bits&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#a33f7a5106eaa80d4c7c73bdadcd7cfef">getChannelNumber</a> () const </td></tr>
<tr class="memitem:a7394df1d9dcee49e2a30bdad55a7b8ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#a7394df1d9dcee49e2a30bdad55a7b8ad">setChannelNumber</a> (u16bits cn)</td></tr>
<tr class="memitem:ad55d3c51cd5882adbc17ab700aea49e5"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#ad55d3c51cd5882adbc17ab700aea49e5">getLength</a> () const </td></tr>
<tr class="memitem:a63c0dc4ff671a8b671f8757cf3518953"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#a63c0dc4ff671a8b671f8757cf3518953">setLength</a> (size_t len)</td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a8ae19badff2d03f509711e0facd4041e"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#a8ae19badff2d03f509711e0facd4041e">constructBuffer</a> ()</td></tr>
<tr class="memitem:a66a94265dda2a2db0dc8565359c861b0"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classturn_1_1StunMsgChannel.html#a66a94265dda2a2db0dc8565359c861b0">check</a> ()</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Channel message </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01087">1087</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a9e2a2b62acf5ad60d306507e94ad3084"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classturn_1_1StunMsgChannel.html#a9e2a2b62acf5ad60d306507e94ad3084">turn::StunMsgChannel::StunMsgChannel</a> </td>
          <td>(</td>
          <td class="paramtype">u16bits&#160;</td>
          <td class="paramname"><em>cn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01089">1089</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">: _cn(cn), _len(length) {};
</pre></div>
</div>
</div>
<a class="anchor" id="a5165aa2f12c89bbe7a7cefb5ce929aa7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classturn_1_1StunMsgChannel.html#a9e2a2b62acf5ad60d306507e94ad3084">turn::StunMsgChannel::StunMsgChannel</a> </td>
          <td>(</td>
          <td class="paramtype">u08bits *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>total_sz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>sz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>constructed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>  throw (<a class="el" href="classturn_1_1WrongStunBufferFormatException.html">WrongStunBufferFormatException</a>)<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01090">1090</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                      :
                        <a class="code" href="classturn_1_1StunMsg.html#a96595cee419124a84d6bfa73407da683">StunMsg</a>(buffer,total_sz,sz,constructed),_cn(0) {

                <span class="keywordflow">if</span>(constructed) {
                        <span class="keywordflow">if</span>(!<a class="code" href="ns__turn__msg_8h.html#a840a56d7d91d92cc60ce9f5d2f128647">stun_is_channel_message_str</a>(buffer,sz,&amp;_cn)) {
                                <span class="keywordflow">throw</span> WrongStunBufferFormatException();
                        }
                        <span class="keywordflow">if</span>(<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>&gt;0xFFFF || <a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>&lt;4)
                                <span class="keywordflow">throw</span> WrongStunBufferFormatException();

                        _len = <a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>-4;
                } <span class="keywordflow">else</span> {
                        <span class="keywordflow">if</span>(total_sz&gt;0xFFFF || total_sz&lt;4)
                                <span class="keywordflow">throw</span> WrongStunBufferFormatException();

                        _len = 0;
                }
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a1eca150860372a9fa24e783f8f9ecc7a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classturn_1_1StunMsgChannel.html#a1eca150860372a9fa24e783f8f9ecc7a">turn::StunMsgChannel::~StunMsgChannel</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01109">1109</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">{}
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a66a94265dda2a2db0dc8565359c861b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool <a class="el" href="classturn_1_1StunMsgChannel.html#a66a94265dda2a2db0dc8565359c861b0">turn::StunMsgChannel::check</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classturn_1_1StunMsg.html#a9c6452d0d71052a0bda4ded876cc43ea">turn::StunMsg</a>.</p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01139">1139</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                             {
                <span class="keywordflow">if</span>(!<a class="code" href="classturn_1_1StunMsg.html#ac00be2fea5b4ab929ea6078871ec33d8">_constructed</a>)
                        <span class="keywordflow">return</span> <span class="keyword">false</span>;
                u16bits cn = 0;
                <span class="keywordflow">if</span>(!<a class="code" href="ns__turn__msg_8h.html#a840a56d7d91d92cc60ce9f5d2f128647">stun_is_channel_message_str</a>(<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>,<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>,&amp;cn)) {
                        <span class="keywordflow">return</span> <span class="keyword">false</span>;
                }
                <span class="keywordflow">if</span>(_cn != cn) {
                        <span class="keywordflow">return</span> <span class="keyword">false</span>;
                }
                <span class="keywordflow">return</span> <span class="keyword">true</span>;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a8ae19badff2d03f509711e0facd4041e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classturn_1_1StunMsgChannel.html#a8ae19badff2d03f509711e0facd4041e">turn::StunMsgChannel::constructBuffer</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classturn_1_1StunMsg.html#a15530c575e485a35f4d87ba7e117d195">turn::StunMsg</a>.</p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01134">1134</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                       {
                <a class="code" href="ns__turn__msg_8h.html#ac18e6049a1a491b4d7352ad62e418f4a">stun_init_channel_message_str</a>(_cn,<a class="code" href="classturn_1_1StunMsg.html#a0222f924d9fc1b9b268ba87c459dd7fd">_buffer</a>,&amp;<a class="code" href="classturn_1_1StunMsg.html#aa3c270c8abbdd22abe101907248754a9">_sz</a>,(<span class="keywordtype">int</span>)_len);
                <a class="code" href="classturn_1_1StunMsg.html#ac00be2fea5b4ab929ea6078871ec33d8">_constructed</a> = <span class="keyword">true</span>;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a33f7a5106eaa80d4c7c73bdadcd7cfef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16bits <a class="el" href="classturn_1_1StunMsgChannel.html#a33f7a5106eaa80d4c7c73bdadcd7cfef">turn::StunMsgChannel::getChannelNumber</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01111">1111</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                         {
                <span class="keywordflow">return</span> _cn;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="ad55d3c51cd5882adbc17ab700aea49e5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classturn_1_1StunMsgChannel.html#ad55d3c51cd5882adbc17ab700aea49e5">turn::StunMsgChannel::getLength</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get length of message itself (excluding the 4 channel number bytes) </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01122">1122</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                 {
                <span class="keywordflow">return</span> _len;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a7394df1d9dcee49e2a30bdad55a7b8ad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgChannel.html#a7394df1d9dcee49e2a30bdad55a7b8ad">turn::StunMsgChannel::setChannelNumber</a> </td>
          <td>(</td>
          <td class="paramtype">u16bits&#160;</td>
          <td class="paramname"><em>cn</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01115">1115</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                          {
                _cn = cn;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a63c0dc4ff671a8b671f8757cf3518953"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classturn_1_1StunMsgChannel.html#a63c0dc4ff671a8b671f8757cf3518953">turn::StunMsgChannel::setLength</a> </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set length of message itself (excluding the 4 channel number bytes) </p>

<p>Definition at line <a class="el" href="TurnMsgLib_8h_source.html#l01129">1129</a> of file <a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a>.</p>
<div class="fragment"><pre class="fragment">                                   {
                _len = len;
        }
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/client++/<a class="el" href="TurnMsgLib_8h_source.html">TurnMsgLib.h</a></li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Tue Jan 22 2013 14:23:55 for TURN Server by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
